<%@ page language="java" contentType="text/html" pageEncoding="utf-8"%>
<%@ include file="header.jsp" %>
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no,minimum-scale=1,maximum-scale=3.0" />
<title>菜品详情 - ${title }</title>
<script type="text/javascript" src="../m/js/jquery.msg.src.js"></script>
<style type="text/css">
body{ background:url(../m/images/c_shop_bg2.png) no-repeat right;}
*{ margin:0; padding:0;}
h3{ color:#FFF;font-size:1em; font-family:"黑体"; line-height:42px; font:42px;}
.clear{ clear:both;}
.content{ width:100%; margin:0 auto; overflow:hidden; margin-top:12.7%;}
.content .title{ color:#686868; font-size:1.2em; font-family:"黑体"; line-height:52px; text-align:left;}
.content .img { overflow:hidden;width:100%;line-height:0;}
.content .img span img  { width:100%;}
.content .img ul { overflow:hidden; background-color:#bda993; border:1px solid #bda993; border-radius:0 0 0.5em 0.5em; /*-moz-box-shadow:5px 5px 5px #000;-webkit-box-shadow:5px 5px 5px #999 ;box-shadow:5px 5px 5px #999 ;  */ }
.content .img ul li {float:left; list-style:none; width:100%; text-align:center; height:42px; line-height:42px; color:#fff;font-size:0.9em; font-family:"黑体"; text-shadow:0px 1px 1px #bda993; }
.content .img ul li img{ height:100%;}
.content .img ul li .price1 {-moz-text-shadow:0px 1px 2px #fff; -webkit-text-shadow: 0px 1px 2px #fff; text-shadow: 0px 1px 2px #ba6e11;color:#fff;font-size:0.9em; font-family:"黑体"; text-decoration:line-through;}
.content .img ul li .price2 {color:#fff;font-size:0.9em; font-family:"黑体"; }
.describe { width:100%;}
.describe p { line-height:22px; color:#000;font-family:"黑体"; }
.buy { overflow:hidden; margin:10px 0 5px 0px; height:auto; line-height:0px;}
.buy .left { width:46%; float:left;}
.buy .left img { width:100%;}
.buy .right { width:46%; float:right;}
.buy .right img { width:100%;}
.cart{ position:fixed; bottom:45px; z-index:10;left:2%; background-image:url('../m/images/cart.png'); background-repeat:no-repeat; height:55px; width:62px; background-size:contain;}
a .cart span{ background-color:#FFF; color:#000; width:20px; height:20px; border:1px #fff solid; border-radius:0.3em; text-decoration:none;margin:2px 0 0 40px;text-decoration:none; }
a{text-decoration:none; height:55px; width:62px;}
#init_count{color: red;padding-left: 5px;padding-right: 5px;}

#description img{width:98%;height:auto;color:#eee;}
</style>
<!-- 
h3{ color:#686868;font-size:1em; font-family:"黑体"; line-height:42px; font:42px;}
description{width:95%; align:center; height:auto;}
.buy { overflow:hidden; margin:10px 0 20px 0px; height:auto; line-height:0px;}
          <ul>
            <li style="width:49%;">¥<span class="price2"><fmt:formatNumber value="${p.price}" pattern="#.00"/></span></li>
          </ul>
 <p style="color:#FFF; font-family:黑体 ;">&nbsp;&nbsp;&nbsp;${p.productName}&nbsp;&nbsp;¥<fmt:formatNumber value="${p.price}" pattern="#.00"/></p>
 -->
<script type="text/javascript">
var p = ${product};

</script>
</head>
<body>
<div class="content" >
       <div class="img">
	       	<div style="position:relative;">
	       			<span>
	       				<img src="${p.images}">
	       			</span>
				<div class="title" style="background:url(../m/images/c_shop_bg.png) no-repeat;opacity:0.8; position:absolute; bottom:0px; width:100%; height:15%;">
					<p style="color:#FFF; font-family:黑体 ;">&nbsp;&nbsp;&nbsp;${p.productName}&nbsp;&nbsp;¥${p.price}</p>
				</div>
	       	</div>
       </div>
     <div style="width:90%;height:auto;margin-left: auto; margin-right: auto;">
	     <div class="buy">
	     	 <div class="left"><a href="javascript:inCart();"><img src="../m/images/join_car.png"/></a></div>
	         <div class="right"><a href="javascript:buynow();"><img src="../m/images/buy_now.png"/></a></div>
	     </div>
	     <div class="describe">
	     	<div>
	     		<h3>菜品描述：</h3>
	     	</div>
	       	<div id="description">
	            ${p.description}
	      	</div>
	      	<br/><br/><br/><br/>
	     </div>
     </div>
</div>

</body>
 <%@ include file="footer_red.jsp" %>
 
 <script type="text/javascript">
//添加进购物车
 function inCart(){
	if(p.price <= 0)
	{
		$.messager.show("已下架,不能购买!",1000,function(){})
		return;
	}
	 $.cart.put(p);
	 $.messager.show("添加成功!",1000,function(){
		 /*window.location.href = "../cart";*/
		 $("#init_count").html($.cart.count());
	 });
 }
 function buynow(){
	if(p.price <= 0)
	{
		$.messager.show("已下架,不能购买!",1000,function(){})
		return;
	}
	 $.cart.put(p);
	 $.messager.show("添加成功，立即前往支付!",1000,function(){
		 window.location.href = "../redcart?cid=${loginId}";
	 });
 }
 $(function(){
	 $("#init_count").html($.cart.count());
 });
 </script>
</html>